﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace FlightTicketModel
{
    [DataContractAttribute(IsReference = true)]
    public class FlightTicketChildTask : EntityBase
    {
        [ForeignKey("Airline")]
        [JsonProperty(IsReference = true)]
        public long AirlineId { get; set; }
        [JsonProperty(IsReference = true)]
        public Airline Airline { get; set; }
        [JsonProperty(IsReference = true)]
        [MaxLength(3)]
        public string AirCode1 { get; set; }
        [JsonProperty(IsReference = true)]
        [MaxLength(3)]
        public string AirCode2 { get; set; }
        [JsonProperty(IsReference = true)]
        [MaxLength(3)]
        public string AirCode3 { get; set; }
        [JsonProperty(IsReference = true)]
        /// <summary>
        /// 出发时间
        /// </summary>
        public DateTime date1 { get; set; }
        [JsonProperty(IsReference = true)]
        /// <summary>
        /// 返程时间
        /// </summary>
        public DateTime? date2 { get; set; }
        [JsonProperty(IsReference = true)]
        public AirLineType AirLineType { get; set; } = AirLineType.OneWay;
        [ForeignKey("FlightTicketTask")]
        [JsonProperty(IsReference = true)]
        public long FlightTicketTaskId { get; set; }
        [JsonProperty(IsReference = true)]
        public virtual FlightTicketTask FlightTicketTask { get; set; }
    }
}
